package org.example.Server.controller.examination;

import lombok.extern.slf4j.Slf4j;
import org.example.Server.model.examination.Exam;
import org.example.Server.model.examination.qs.QsExamDTO;
import org.example.Server.service.examination.TeachExamDataService;
import org.example.Server.utils.ResultAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/youxich/exam/qs")
public class TeachExamQsController {
    @Autowired
    private TeachExamDataService teachExamDataService;

    /**
     * 获取考试试卷题目列表
     *
     * @param exam
     * @return
     */
    @GetMapping("/list")
    public ResultAPI getlist(Exam exam) {
        return teachExamDataService.getExamQsList(exam);
    }

    /**
     * 获取单个题的具体内容（具体题型具体分析
     *
     * @param exam
     * @return
     */
    @GetMapping("/detail")
    public ResultAPI getQs(QsExamDTO exam) {
        log.info("题目详情数据获取的参数{}:", exam);
        return teachExamDataService.getQs(exam);
    }

}
